//
//  PhotoGroupCell.m
//  JigSaw
//
//  Created by Slim Wang on 15/1/6.
//  Copyright (c) 2015年 LITB. All rights reserved.
//

#import "JSPhotoGroupCell.h"
#import "UIColor+Help.h"
@implementation JSPhotoGroupCell

- (void)awakeFromNib {
    // Initialization code
    //#7b8085
    self.name.textColor = [UIColor colorWithHex:0x7b8085];
    //#abb2ba
    self.count.textColor = [UIColor colorWithHex:0xabb2ba];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setThumbnails:(NSArray*)thumbnails
{
    self.iv0.image = nil;
    self.iv1.image = nil;
    self.iv2.image = nil;
    int i = 0;
    for (UIImage* thumbnail in thumbnails) {
        switch (i) {
            case 0:
                self.iv0.image = thumbnail;
                [self setShadow:self.iv0];
                break;
            case 1:
                self.iv1.image = thumbnail;
                [self setShadow:self.iv1];
                break;
            case 2:
                self.iv2.image = thumbnail;
                [self setShadow:self.iv2];
                break;
            default:
                break;
        }
        i++;
    }
}

- (void)setShadow:(UIImageView*)imageView
{
    imageView.layer.shadowOpacity = 1;
    imageView.layer.shadowColor = [[UIColor whiteColor] CGColor];
    imageView.layer.shadowOffset = CGSizeMake(0, -1);
    imageView.layer.masksToBounds = NO;
    imageView.layer.shadowPath = [[UIBezierPath bezierPathWithRect:imageView.bounds] CGPath];
    imageView.layer.shadowRadius = 0;

}
@end
